package work20241203_chap6oop.o_demo12;

/**
 * @author zdl
 * @date 2024/12/5
 */
//正方形
public class Square extends Shape{
    private int a;

    public Square() {
    }

    public Square(int a) {
        this.a = a;
    }

    @Override
    public double area() {
        return a*a;
    }

    /**
     * 获取
     * @return a
     */
    public int getA() {
        return a;
    }

    /**
     * 设置
     * @param a
     */
    public void setA(int a) {
        this.a = a;
    }

    public String toString() {
        return "Square{a = " + a + "}";
    }
}
